package marke.barak.windows.composit;

import java.util.Date;

import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.DateTime;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Label;
import org.eclipse.wb.swt.SWTResourceManager;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

public class RunReport extends Composite {

	/**
	 * Create the composite.
	 * @param parent
	 * @param style
	 */
	public RunReport(Composite parent, int style) {
		super(parent, style);
		
		final DateTime dateTimeFrom = new DateTime(this, SWT.BORDER);
		dateTimeFrom.setBounds(10, 29, 87, 21);
		
		Label lblNewLabel = new Label(this, SWT.NONE);
		lblNewLabel.setFont(SWTResourceManager.getFont("Tahoma", 10, SWT.BOLD));
		lblNewLabel.setBounds(10, 10, 49, 13);
		lblNewLabel.setText("FROM");
		
		final DateTime dateTimeTo = new DateTime(this, SWT.BORDER);
		dateTimeTo.setBounds(140, 29, 87, 21);
		
		Label To = new Label(this, SWT.NONE);
		To.setText("TO");
		To.setFont(SWTResourceManager.getFont("Tahoma", 10, SWT.BOLD));
		To.setBounds(139, 10, 49, 13);
		
		Button btnRunn = new Button(this, SWT.NONE);
		btnRunn.addSelectionListener(new SelectionAdapter() {
			@SuppressWarnings("deprecation")
			@Override
			public void widgetSelected(SelectionEvent e) {
				Date od = null;
				Date to = null;
				od = new Date(dateTimeFrom.getYear(),dateTimeFrom.getMonth(),dateTimeFrom.getDay());
				to = new Date(dateTimeTo.getYear(),dateTimeTo.getMonth(),dateTimeTo.getYear());
				
				
			}
		});
		btnRunn.setBounds(372, 267, 68, 23);
		btnRunn.setText("RUN");

	}

	@Override
	protected void checkSubclass() {
		// Disable the check that prevents subclassing of SWT components
	}
}
